import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import registerGlobalComponents from "./component/index.js";
import Antd from "ant-design-vue";
import "ant-design-vue/dist/reset.css";
import "@/utils/message.js";
import "@/assets/tailwind/index.css";
import "@/assets/app/index.css";
import "@/assets/antd/index.css";

import { ConfigProvider } from "ant-design-vue";
import zhCN from "ant-design-vue/es/locale/zh_CN";

const app = createApp(App);

registerGlobalComponents(app);
app.use(Antd).use(store).use(router);

app.component("ConfigProvider", ConfigProvider);
app.mount("#app", {
  props: {
    defaultConfig: {
      locale: zhCN,
    },
  },
});

const resizeObserverErrHandler = (err) => {
  if (err.message.includes("ResizeObserver")) return;
  console.error(err);
};
window.addEventListener("error", resizeObserverErrHandler);
